import * as React from 'react';
import { connect  } from 'react-redux';
import {addTodo} from './action';
interface AppProps {
}

interface AppState {
}
const reducerAction ={
  type:'SET_VISIBILITY_FILTER',
  todos:{}
}
const mapStateToProps = store => {
  return {
    reducera: store.reducera
  }
}
​
const mapDispatchToProps = (dispatch) => {
  return {
    onitClick: () => {
      console.log('dispatch');
      
      dispatch(addTodo)
    }
  }
}

class AModuleOrigin extends React.Component<AppProps, AppState> {
  constructor(props: AppProps) {
    super(props);

        this.state = {
    }
    console.log(this.props);
    this.onTodoClick = this.onTodoClick.bind(this);
  }
  onTodoClick(){
    this.props.onitClick();
  }
  render() {
    return (
      // console.log(this.props.)
      <div className="pageA">
        a module
        <button onClick={this.onTodoClick}>dispatch</button>
      </div>
    );
  }
}

export const AModule = connect(mapStateToProps,mapDispatchToProps)(AModuleOrigin);